---------------------------------------------------------------------------------------------------------------------------------------------------------
      name:  <unnamed>
       log:  /Users/wesleyblundell/Dropbox/Wes_Supplemental_NEI/JAERE_Replication/Replication_package/log/Table_A7_Results.log
  log type:  text
 opened on:  15 May 2024, 11:46:18

. eststo clear

. use "$rootpath/processed_data/Estimation_Data.dta", clear

. drop if key_estimation_sample==0
(273,947 observations deleted)

. sort state_number year

. egen min_damage=min(log_damage55), by(state_number year)

. egen min_emissions=min(log_emissions4), by(state_number year)

. egen max_damages=max(log_damage55), by(state_number year)

. egen max_emissions=max(log_emissions4), by(state_number year)

.   
. sort state_number year

. quietly by state_number year:  gen dups = cond(_N==1,0,_n) 

. drop if dups>1
(698,533 observations deleted)

. drop dups

. ///This is the robustness check regarding mins and maxes. 
> rename avg_old_code_prob policy

. regress min_damage policy, cluster(state_number)

Linear regression                               Number of obs     =        480
                                                F(1, 47)          =       0.36
                                                Prob > F          =     0.5521
                                                R-squared         =     0.0019
                                                Root MSE          =     4.2e-06

                          (Std. Err. adjusted for 48 clusters in state_number)
------------------------------------------------------------------------------
             |               Robust
  min_damage |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
      policy |   8.00e-07   1.34e-06     0.60   0.552    -1.89e-06    3.49e-06
       _cons |   4.73e-07   4.62e-07     1.02   0.312    -4.58e-07    1.40e-06
------------------------------------------------------------------------------

. estimates store min_dam

. regress max_damages policy, cluster(state_number)

Linear regression                               Number of obs     =        480
                                                F(1, 47)          =       0.00
                                                Prob > F          =     0.9805
                                                R-squared         =     0.0000
                                                Root MSE          =     1.1006

                          (Std. Err. adjusted for 48 clusters in state_number)
------------------------------------------------------------------------------
             |               Robust
 max_damages |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
      policy |   .0248988   1.012839     0.02   0.980     -2.01267    2.062467
       _cons |   7.216374   .3199983    22.55   0.000     6.572621    7.860128
------------------------------------------------------------------------------

. estimates store max_dam

. regress min_emissions policy, cluster(state_number)

Linear regression                               Number of obs     =        480
                                                F(1, 47)          =       0.09
                                                Prob > F          =     0.7675
                                                R-squared         =     0.0005
                                                Root MSE          =     6.4e-06

                          (Std. Err. adjusted for 48 clusters in state_number)
------------------------------------------------------------------------------
             |               Robust
min_emissi~s |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
      policy |  -5.95e-07   2.00e-06    -0.30   0.767    -4.62e-06    3.43e-06
       _cons |   1.21e-06   8.72e-07     1.38   0.173    -5.47e-07    2.96e-06
------------------------------------------------------------------------------

. estimates store min_emit

. regress max_emissions policy, cluster(state_number)

Linear regression                               Number of obs     =        480
                                                F(1, 47)          =       1.40
                                                Prob > F          =     0.2431
                                                R-squared         =     0.0597
                                                Root MSE          =     .63956

                          (Std. Err. adjusted for 48 clusters in state_number)
------------------------------------------------------------------------------
             |               Robust
max_emissi~s |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
      policy |  -.7030296   .5946828    -1.18   0.243    -1.899377    .4933179
       _cons |     6.5698   .1912498    34.35   0.000     6.185055    6.954545
------------------------------------------------------------------------------

. estimates store max_emit

. 
. 
. use "$rootpath/processed_data/Estimation_Data.dta", clear

. drop if key_estimation_sample==0
(273,947 observations deleted)

. reghdfe  log_emissions4 treatXpost [aweight=new_weight], absorb(facility_id n5#year) vce(cluster facility_id)
(MWFE estimator converged in 204 iterations)

HDFE Linear regression                            Number of obs   =    699,013
Absorbing 2 HDFE groups                           F(   1,  81431) =       5.63
Statistics robust to heteroskedasticity           Prob > F        =     0.0177
                                                  R-squared       =     0.9401
                                                  Adj R-squared   =     0.9314
                                                  Within R-sq.    =     0.0000
Number of clusters (facility_id) =     81,432     Root MSE        =     0.3033

                       (Std. Err. adjusted for 81,432 clusters in facility_id)
------------------------------------------------------------------------------
             |               Robust
log_emissi~4 |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
  treatXpost |  -.0241171   .0101652    -2.37   0.018    -.0440409   -.0041934
       _cons |   .6802303   .0015073   451.28   0.000     .6772759    .6831846
------------------------------------------------------------------------------

Absorbed degrees of freedom:
-----------------------------------------------------+
 Absorbed FE | Categories  - Redundant  = Num. Coefs |
-------------+---------------------------------------|
 facility_id |     81432       81432           0    *|
     n5#year |      6834           1        6833     |
-----------------------------------------------------+
* = FE nested within cluster; treated as redundant for DoF computation

. estimates store new_weight_emit

. reghdfe  log_damage55 treatXpost [aweight=new_weight], absorb(facility_id n5#year) vce(cluster facility_id)
(MWFE estimator converged in 200 iterations)

HDFE Linear regression                            Number of obs   =    699,013
Absorbing 2 HDFE groups                           F(   1,  81431) =      11.45
Statistics robust to heteroskedasticity           Prob > F        =     0.0007
                                                  R-squared       =     0.9396
                                                  Adj R-squared   =     0.9309
                                                  Within R-sq.    =     0.0001
Number of clusters (facility_id) =     81,432     Root MSE        =     0.3559

                       (Std. Err. adjusted for 81,432 clusters in facility_id)
------------------------------------------------------------------------------
             |               Robust
log_damage55 |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
  treatXpost |  -.0390724   .0115446    -3.38   0.001    -.0616997   -.0164451
       _cons |   .8216152   .0017119   479.95   0.000     .8182599    .8249704
------------------------------------------------------------------------------

Absorbed degrees of freedom:
-----------------------------------------------------+
 Absorbed FE | Categories  - Redundant  = Num. Coefs |
-------------+---------------------------------------|
 facility_id |     81432       81432           0    *|
     n5#year |      6834           1        6833     |
-----------------------------------------------------+
* = FE nested within cluster; treated as redundant for DoF computation

. estimates store new_weight_dam

. 
. esttab min_dam min_emit max_dam max_emit  new_weight_dam new_weight_emit using "$rootpath/table_graph/TBL_A7.tex",  star( * 0.1 ** 0.05 *** 0.01) cells
> (b(star fmt(3)) se(par fmt(3))) keep(policy treatXpost) scalars(N F) ar2 replace
(note: file /Users/wesleyblundell/Dropbox/Wes_Supplemental_NEI/JAERE_Replication/Replication_package/table_graph/TBL_A7.tex not found)
(output written to /Users/wesleyblundell/Dropbox/Wes_Supplemental_NEI/JAERE_Replication/Replication_package/table_graph/TBL_A7.tex)

. 
. 
. 
. log close
      name:  <unnamed>
       log:  /Users/wesleyblundell/Dropbox/Wes_Supplemental_NEI/JAERE_Replication/Replication_package/log/Table_A7_Results.log
  log type:  text
 closed on:  15 May 2024, 11:47:22
---------------------------------------------------------------------------------------------------------------------------------------------------------
